package com.jltx.xq.simplewatch.utils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import retrofit2.converter.gson.GsonConverterFactory;

/**
 * @author jltxseo
 *         Created by junlintianxia on 2017/08/26.
 */

public class GsonFactoryUtils {
    public static Gson providerGson(){
        return new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();  //对不带@Expose注解的属性进行序列化和反系列化
    }


    public static GsonConverterFactory providerGsonConverterFactory(){
        Gson gson = providerGson();
        return GsonConverterFactory.create(gson);
    }
}
